//
//  YWMaterialStockOut.m
//  maintain
//
//  Created by 烟雨云渊 on 16/9/3.
//  Copyright © 2016年 ewin. All rights reserved.
//

#import "YWMaterialStockOut.h"
#import "YWCommonTool.h"
#import "YWHandler.h"

@implementation YWMaterialStockOut
+ (NSArray *)mj_ignoredPropertyNames
{
    return @[@"replies"];
}
+ (NSDictionary*)mj_objectClassInArray
{
    return @{@"creator" : @"YWHandler",
             @"receiver" : @"YWHandler",
             @"observers" : @"YWHandler",
             @"details" : @"YWMaterialStockOutDetail",
             @"materialApply" : @"YWMaterialApply"
             };
}

- (void)mj_keyValuesDidFinishConvertingToObject{
    NSMutableString *copyids = [[NSMutableString alloc] init];
    [self.observers enumerateObjectsUsingBlock:^(YWHandler*  _Nonnull handler, NSUInteger idx, BOOL * _Nonnull stop) {
        if (idx!=0) {
            [copyids appendString:@","];
        }
        [copyids appendString:[@(handler.uniqueId) stringValue]];
    }];
    self.carbonCopyIds = [NSString stringWithFormat:@"%@",copyids];

    self.yearMonthDay = [YWCommonTool  showChineseFormatterDate:self.stockOutTime/1000];
}
@end
